package com.zc.custom.mapper;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zc.custom.domain.ChargeCustomOrderInfo;
import com.zc.trendsDispatch.domain.ChargePileOrderInfo;
import org.apache.ibatis.annotations.Param;

/**
 * 用户订单Mapper接口
 *
 * @author glb
 * @date 2023-05-19
 */
public interface ChargeCustomOrderInfoMapper {
    /**
     * 查询用户订单
     *
     * @param orderInfoId 用户订单主键
     * @return 用户订单
     */
    public ChargeCustomOrderInfo selectChargeCustomOrderInfoByOrderInfoId(Long orderInfoId);

    public List<HashMap> getInfoCount();

    public ChargeCustomOrderInfo selectChargeCustomOrderInfoByOrderInfoCode(String orderInfoCode);

    public List<ChargeCustomOrderInfo> selectChargeCustomOrderInfoAllList(ChargeCustomOrderInfo chargeCustomOrderInfo);

    /**
     * 充电记录
     *
     * @param chargeCustomOrderInfo 用户订单主键
     */
    public List<Map<String, Object>> getChargingRecordList(ChargeCustomOrderInfo chargeCustomOrderInfo);

    Map<String, Object> getChargingRecordDetails(String transactionNum);

    ChargePileOrderInfo getChargePileOrderInfoByCode(ChargePileOrderInfo chargePileOrderInfo);

    /**
     * 查询用户订单列表
     *
     * @param chargeCustomOrderInfo 用户订单
     * @return 用户订单集合
     */
    List<ChargeCustomOrderInfo> selectChargeCustomOrderInfoList(ChargeCustomOrderInfo chargeCustomOrderInfo);

    /**
     * 新增用户订单
     *
     * @param chargeCustomOrderInfo 用户订单
     * @return 结果
     */
    int insertChargeCustomOrderInfo(ChargeCustomOrderInfo chargeCustomOrderInfo);

    /**
     * 修改用户订单
     *
     * @param chargeCustomOrderInfo 用户订单
     * @return 结果
     */
    int updateChargeCustomOrderInfo(ChargeCustomOrderInfo chargeCustomOrderInfo);

    int updateChargeCustomOrderInfoByCode(ChargeCustomOrderInfo chargeCustomOrderInfo);

    /**
     * 删除用户订单
     *
     * @param orderInfoId 用户订单主键
     * @return 结果
     */
    int deleteChargeCustomOrderInfoByOrderInfoId(Long orderInfoId);

    /**
     * 批量删除用户订单
     *
     * @param orderInfoIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteChargeCustomOrderInfoByOrderInfoIds(Long[] orderInfoIds);

    /**
     * 获取指定时间段内设备充电记录
     *
     * @param deviceCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<ChargeCustomOrderInfo> getOrderList(@Param("deviceCode") String deviceCode, @Param("portId") String portId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    //退款时根据客户openid和设备信息查询订单
    ChargeCustomOrderInfo queryOrderInfo(@Param("orderCode") String orderCode);

    //
    List<Map<String, Object>> queryStationStats(@Param("deviceId") String deviceId,@Param("StartTime") String StartTime,@Param("EndTime") String EndTime);
}
